package fi.internetix.ck;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class GenericStripNodePrinter extends HTMLNodePrinter {
  
  public GenericStripNodePrinter(boolean processChildren) {
    this.processChildren = processChildren;
  }

  public void processNode(Node node, StringBuilder output) {
    if (processChildren) {
      NodeList children = node.getChildNodes();
      for (int i = 0; i < children.getLength(); i++) {
        Node child = children.item(i);
        NodePrinter nodePrinter = NodePrinterUtils.getNodePrinter(child);
        if (nodePrinter != null) {
          nodePrinter.processNode(child, output);
        }
      }
    }
  }
  
  private boolean processChildren;

}
